/*
 * Steamname prüfen..
 */
function CheckSteamName(shortcut)
{
    var name = document.signup.steam_name.value;
    var xmlhttp;
    if (name.length == 0)
    {
        document.getElementById("check_steamname").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_steamname").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_steamname").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check.php?q=checkteam&val=" + name + "&shortcut=" + shortcut, true);
    xmlhttp.send();
}

/*
 * Teaminfos 
 */
function GetTeamInfo(shortcut)
{
    var team_id = document.signup.select_team.value;
    var xmlhttp;
    if (name.team_id == 0)
    {
        document.getElementById("teaminfo").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("teaminfo").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("teaminfo").innerHTML = "Hole Teaminfo..";
        }
    }
    xmlhttp.open("GET", "check.php?q=team&val=" + team_id + "&shortcut=" + shortcut, true);
    xmlhttp.send();
}

/*
 * Fahrzeuginfos
 */
function GetVehicleInfo(shortcut)
{
    var vehicle_id = document.signup.select_vehicle.value;
    var xmlhttp;
    if (vehicle_id.length == 0)
    {
        document.getElementById("vehicleinfo").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("vehicleinfo").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("vehicleinfo").innerHTML = "Hole Fahrzeuginfo..";
        }
    }
    xmlhttp.open("GET","check.php?q=vehicle&val=" + vehicle_id + "&shortcut=" + shortcut, true);
    xmlhttp.send();
}

/*
 * Teamname prüfen..
 */
function CheckTeamName(shortcut)
{
    var team_name = document.team_creation.team_name.value;
    var xmlhttp;
    if (team_name.length == 0)
    {
        document.getElementById("check_teamname").innerHTML = "";
        return;
    }
    // IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById("check_teamname").innerHTML = xmlhttp.responseText;
        }
        else
        {
            document.getElementById("check_teamname").innerHTML = "Prüfe..";
        }
    }
    xmlhttp.open("GET","check.php?q=checkteam&val=" + team_name + "&shortcut=" + shortcut, true);
    xmlhttp.send();
}

/*
 * Alle Infos der am Start ausgewählten Sachen..
 */
function GetInfo(shortcut)
{
    GetTeamInfo(shortcut);
    GetVehicleInfo(shortcut);
}